package cn.enjoy.design.create.factory.abstractFactory.factory;

import cn.enjoy.design.create.factory.abstractFactory.product1.Circle;
import cn.enjoy.design.create.factory.abstractFactory.product1.Rectangle;
import cn.enjoy.design.create.factory.abstractFactory.product1.Shape;
import cn.enjoy.design.create.factory.abstractFactory.product1.Square;
import cn.enjoy.design.create.factory.abstractFactory.product2.Color;

/**
 * @author K
 * @date 2021/5/22 下午4:42
 */
public class ShapeFactory extends AbstractFactory {

    @Override
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return null;
        }
        if(shapeType.equalsIgnoreCase("CIRCLE")){
            return new Circle();
        } else if(shapeType.equalsIgnoreCase("RECTANGLE")){
            return new Rectangle();
        } else if(shapeType.equalsIgnoreCase("SQUARE")){
            return new Square();
        }
        return null;
    }

    @Override
    public Color getColor(String color) {
        return null;
    }
}
